package com.lindroy.jetpacknotes.hilt

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.activity.viewModels
import com.lindroy.jetpacknotes.R
import dagger.hilt.android.AndroidEntryPoint
import okhttp3.OkHttpClient
import okhttp3.Request
import javax.inject.Inject

@AndroidEntryPoint
class HiltActivity : AppCompatActivity() {

    private val TAG = "Hilt"

    @Inject
    lateinit var userManager: UserManager

    @Inject
    lateinit var okHttpClient: OkHttpClient

    @Inject
    lateinit var okHttpClient2: OkHttpClient

    private val viewModel by viewModels<HiltViewModel>()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_hilt)
        Log.d(TAG, "user name : ${userManager.getUserName()}")

        Log.d(TAG, "okHttpClient = $okHttpClient")
        Log.d(TAG, "okHttpClient2 = $okHttpClient2")

        Log.d(TAG, "viewModel = $viewModel")
    }
}